﻿<selc:SelectControl x:Class="jSLApp.Client.Forms.FilmList"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                    xmlns:j="clr-namespace:jSLCore.Client.Presentation.Controls;assembly=jSLCore.Client.Presentation"
                    xmlns:Selection="clr-namespace:jSLCore.Client.Presentation.Wpf.TelerikSupport.Selection;assembly=jSLCore.Client.Presentation.Telerik"
                    xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
                    xmlns:BaseConverters="clr-namespace:jSLCore.Client.Presentation.jBinding.BaseConverters;assembly=jSLCore.Client.Presentation"
                    xmlns:radc="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
                    xmlns:selc="clr-namespace:jSLCore.Client.Presentation.BaseControl.Selection;assembly=jSLCore.Client.Presentation" xmlns:Columns="clr-namespace:jSLCore.Client.Presentation.Wpf.TelerikSupport.Selection.Columns;assembly=jSLCore.Client.Presentation.Telerik" xmlns:rad="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:telerikTransitions="clr-namespace:Telerik.Windows.Controls.TransitionEffects;assembly=Telerik.Windows.Controls" xmlns:local="clr-namespace:jSLApp.Client.Controls" mc:Ignorable="d"
                    AcceptButtonName="searchButton"
    d:DesignHeight="300" d:DesignWidth="700">	
        <j:ImageGroupBox Header="Поиск" ImageSource="../Resources/search.png">
        	<VisualStateManager.VisualStateGroups>
        		<VisualStateGroup x:Name="ListLoading">
        			<VisualStateGroup.Transitions>
        				<VisualTransition GeneratedDuration="0:0:0.2"/>
        			</VisualStateGroup.Transitions>
        			<VisualState x:Name="Ready"/>
        			<VisualState x:Name="Loading">
        				<Storyboard>
        					<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="textBlock" d:IsOptimized="True"/>
        				</Storyboard>
        			</VisualState>
        		</VisualStateGroup>
        	</VisualStateManager.VisualStateGroups>
            <Grid>
                <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition/>
                </Grid.ColumnDefinitions>				
                <Grid Grid.Column="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <j:ImageGroupBox Header="Ключевое слово" Grid.Row="0">
                        <StackPanel Orientation="Vertical">
                            <radc:RadMaskedTextBox x:Name="txt" MaskType="None" EmptyContent="Поиск..." VerticalAlignment="Center" Width="150" rad:RadDockPanel.Dock="Right"/>
                            <CheckBox Content="Искать только в названии" Name="ch" IsChecked="True" HorizontalAlignment="Left"/>
                            <Button HorizontalAlignment="Right" Content="Искать" Name="searchButton"/>
                            <j:HelpBox Text="Для поиска по описанию и тэгам уберите галочку 'Искать только в названии'" Width="181" />
                        </StackPanel>
                    </j:ImageGroupBox>
                    <j:ImageGroupBox Header="Поиск по жанрам" Grid.Row="1" ImageSource="../Resources/help.png">
                    <rad:RadDockPanel LastChildFill="True">
                        <HyperlinkButton rad:RadDockPanel.Dock="Top" Content="Показать все" Click="allGenres_Clicked"/>
                        <local:GenreGrid x:Name="genreGrid" Cursor="Hand" SelectionChanged="genre_Changed" ShowColumnHeaders="False">
                            
                        </local:GenreGrid>
                    </rad:RadDockPanel>
                </j:ImageGroupBox>
                </Grid>
                <j:ImageGroupBox Grid.Column="1" ImageSource="../Resources/Task.png">
                <j:ImageGroupBox.Header>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Name="resultAbout" Text="Результат поиска"/>
                        <HyperlinkButton Content="Загрузить все" Click="LoadAll_Clicked" Name="loadAllButton" Visibility="Collapsed"/>
                        <TextBlock x:Name="textBlock" Text="Выполняется загрузка..." Opacity="0" Foreground="{StaticResource orangeBorder}"/>
                    </StackPanel>
                </j:ImageGroupBox.Header>
                <Selection:jSLRadGrid x:Name="grid" 
                                      ShowGroupPanel="False" 
                                      DataLoadMode="Asynchronous"                                      
                                      RowLoaded="genreName_Loaded"  
                                      EnableRowVirtualization="True" 
                                      GoDetailsOrSelectOnDoubleClick="True"
                                      GoDetailsClick="goFilm_Clicked" 
                                      rad:StyleManager.Theme="Transparent">                       
                        <Selection:jSLRadGrid.Columns>
                        <Controls:GridViewDataColumn>
                            <Controls:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <Image Grid.Column="0" ToolTipService.ToolTip="Содержимое может содержать сцены насилия или сцены эротики. Не рекомендуется к просмотру лицами, не достигшими 18-ти лет, а так же людям со слабой психикой." Source="../Resources/18Icon.png" Stretch="Uniform" Width="16" Height="16" Margin="0">
                                            <Image.Visibility>
                                                <Binding Path="AgeNeed">
                                                    <Binding.Converter>
                                                        <BaseConverters:jBoolToVisibilityConverter/>
                                                    </Binding.Converter>
                                                </Binding>
                                            </Image.Visibility>
                                        </Image>
                                        <Image Grid.Column="1" Source="../Resources/SmoothStreaming.png" ToolTipService.ToolTip="Smooth Streaming источник. Видео может быть просмотрено в High Quality или High Depth режимах при наличии быстрого интернет соединения" Stretch="Uniform" Width="16" Height="16" Margin="0" HorizontalAlignment="Left">
                                            <Image.Visibility>
                                                <Binding Path="IsSmoothStreaming">
                                                    <Binding.Converter>
                                                        <BaseConverters:jBoolToVisibilityConverter/>
                                                    </Binding.Converter>
                                                </Binding>
                                            </Image.Visibility>
                                        </Image>
                                    </StackPanel>
                                </DataTemplate>
                            </Controls:GridViewDataColumn.CellTemplate>
                        </Controls:GridViewDataColumn>
                        <Controls:GridViewDataColumn>
                                <Controls:GridViewDataColumn.CellTemplate>
                                    <DataTemplate>
                                        <Image Height="32" Width="32" Margin="0">
                                            <Image.Source>
                                                <Binding Path="SmallCover">
                                                    <Binding.Converter>
                                                        <BaseConverters:jImageSourceConverter/>
                                                    </Binding.Converter>
                                                </Binding>
                                            </Image.Source>
                                        <ToolTipService.ToolTip>
                                            <Binding Path="Description"/>
                                        </ToolTipService.ToolTip>
                                    </Image>
                                    </DataTemplate>
                                </Controls:GridViewDataColumn.CellTemplate>
                            </Controls:GridViewDataColumn>                                
                            <Columns:GoDetailsColumn Header="Название" DataMemberBinding="{Binding Name}" Width="200"/>
                            <Controls:GridViewDataColumn Header="Жанр" DataMemberBinding="{Binding GenreName}">
                                <Controls:GridViewDataColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding GenreName}" Tag="{Binding id}"/>
                                    </DataTemplate>
                                </Controls:GridViewDataColumn.CellTemplate>
                            </Controls:GridViewDataColumn>
                            <Controls:GridViewDataColumn Header="Год" DataMemberBinding="{Binding Year}"/>
                        <Controls:GridViewDataColumn Header="Страна" DataMemberBinding="{Binding Country}"/>
                        <Controls:GridViewDataColumn Header="Оценки" DataMemberBinding="{Binding Rating}">
                                <Controls:GridViewDataColumn.CellTemplate>
                                    <DataTemplate>
                                        <radc:RadRating Value="{Binding Rating}" IsReadOnly="True"/>
                                    </DataTemplate>
                                </Controls:GridViewDataColumn.CellTemplate>
                            </Controls:GridViewDataColumn>                        
                        <Columns:jSLMoneyColumn Header="Цена" DataMemberBinding="{Binding Price}"/>                        
                    </Selection:jSLRadGrid.Columns>                                      
                    </Selection:jSLRadGrid>
                </j:ImageGroupBox>           
        </Grid>
        </j:ImageGroupBox>    
</selc:SelectControl>
